package router

import (
	"database/sql"

	"gitee.com/hp-huiw/family-expense-api/internal/handler"
	"github.com/gin-gonic/gin"
)

// Sets routes for user resource.
func SetUserRoutes(routerGroup *gin.RouterGroup, db *sql.DB) {
	h := handler.NewUserHandler(db)

	routerGroup.GET("/query-details", h.QueryDetails)
	routerGroup.GET("/query-users-not-in-account-group", h.QueryUsersNotInAccountGroup)
	routerGroup.GET("/query-account-group-users", h.QueryAccountGroupUsers)
	routerGroup.POST("/update-password", h.UpdatePassword)
	routerGroup.POST("/update-current-user", h.UpdateCurrentUser)
	routerGroup.POST("/update-current-user-password", h.UpdateCurrentUserPassword)
	routerGroup.POST("/update-roles", h.UpdateRoles)
}
